home *** CD-ROM | disk | FTP | other *** search
- public class EffectDiscMajesty extends Codex {
- private static final float TICK_RATE = 2.0F;
- private static final int TICK_DURATION = 5000;
- private static final float RADIUS = 384.0F;
- private float[] position = new float[3];
- private int padGuid;
- private int _casterGuid;
-
- public void EndEffect() {
- CodexThing pad = new CodexThing(this.padGuid);
- pad.Remove();
- ((Codex)this).KillAllTimers();
- }
-
- public void restore(int flags) {
- this.padGuid = CodexSequence.RestoreInt();
- this._casterGuid = CodexSequence.RestoreInt();
- }
-
- public void effectstarted(int actorGuid, int effectGuid, int creatorGuid, int duration) {
- this._casterGuid = actorGuid;
- CodexActor caster = new CodexActor(this._casterGuid);
- ((CodexThing)caster).SpawnThing("yellowMagic");
- this.padGuid = ((CodexThing)caster).SpawnThing("ankhsPadYellow");
- float[] offset = new float[3];
- offset[0] = offset[1] = offset[2] = 0.0F;
- ((CodexThing)caster).AttachThing(this.padGuid, -1, offset, 1);
- ((Codex)this).CaptureThing(actorGuid);
- ((Codex)this).SetTimer(0.1F);
- }
-
- public void killed(int guid, int causeID, int captureID) {
- this.EndEffect();
- }
-
- public void save(int flags) {
- CodexSequence.SaveInt(this.padGuid);
- CodexSequence.SaveInt(this._casterGuid);
- }
-
- public void timer(int timerID, float arg0, float arg1, float arg2, float arg3) {
- CodexActor caster = new CodexActor(this._casterGuid);
- this.position = ((CodexThing)caster).GetPosition();
- CodexCollision query = new CodexCollision();
- query.IgnoreAll();
- query.AcceptType(0);
- if (!Codex.IsPlayerGuid(((Codex)caster).GetGUID())) {
- query.AcceptType(7);
- }
-
- int numResults = query.ThingsInSphere(this.position, 384.0F, ((Codex)caster).GetGUID());
-
- for(int i = 0; i < numResults; ++i) {
- int result = query.GetResult(i);
- if (result != ((Codex)caster).GetGUID()) {
- CodexActor victim = new CodexActor(result);
- int effectGuid = victim.FindActorEffect("ef_disc_majesty2");
- if (effectGuid != 0) {
- victim.ExpandActorEffect(effectGuid, 5000, false);
- } else {
- victim.AddActorEffectByLevel("ef_disc_majesty2", 5000, 0, ((Codex)caster).GetGUID(), 4);
- }
- }
- }
-
- query.Free();
- ((Codex)this).SetTimer(2.0F);
- }
-
- public void effectended(int actorGuid, int effectGuid, int creatorGuid, int reason) {
- this.EndEffect();
- }
- }
-